global root "C:\Users\hanwa\Desktop\replication"

use "$root\data\IMC_HA_Quarterly_Panel_clean.dta", replace

***Panel A: Debt identified
preserve
drop if startdate==-1
keep if cem_matched==1
stackedev identir imc, cohort(startdate) time(yearquarter) never_treat(no_treat) unit_fe(code) clust_unit(code) 
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se replace
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev identir imc, cohort(startdate) time(yearquarter) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage)
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev identir imc, cohort(startdate) time(yearquarter) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev identir imc, cohort(startdate) time(region_yq) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

***Panel B: Debt recovered
preserve
drop if startdate==-1
keep if cem_matched==1
stackedev recover imc, cohort(startdate) time(yearquarter) never_treat(no_treat) unit_fe(code) clust_unit(code) 
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev recover imc, cohort(startdate) time(yearquarter) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage)
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev recover imc, cohort(startdate) time(yearquarter) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev recover imc, cohort(startdate) time(region_yq) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

***Panel C: Debt written off
preserve
drop if startdate==-1
keep if cem_matched==1
stackedev writter imc, cohort(startdate) time(yearquarter) never_treat(no_treat) unit_fe(code) clust_unit(code) 
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev writter imc, cohort(startdate) time(yearquarter) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage)
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev writter imc, cohort(startdate) time(yearquarter) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev writter imc, cohort(startdate) time(region_yq) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table4", excel symbol(***,**,*) se append
restore

